package uy.com.dino.samefile;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import uy.com.dino.samefile.model.Review;
import uy.com.dino.samefile.service.ReviewService;

public class testLP {
    public static void main(String[] args) {
        try {

            final String[] SPRING_CONFIG_FILES = {
                    "application-context.xml",
                    "application-context-loader.xml",
                    "application-context-service-dao.xml"
            };

            ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                    SPRING_CONFIG_FILES);


            System.out.println("Starting review... ");

            ReviewService reviewService = (ReviewService) applicationContext.getBean("reviewService");
            //Review review = reviewService.executeReview("linux-i7-facultad", "/home/cesar/documents/facultad/");
            //reviewService.saveReview(review);
            //reviewService.exportReview(review, "linux-i7-facultad.xml");

            //Review review = reviewService.importReview("linux.xml");
            //reviewService.compareReviews("linux-i7", "linux-i6");
            
            Review review1 = reviewService.importReview("linux-i7-work.xml");
            Review review2 = reviewService.importReview("windows-work.xml");
            reviewService.compareReviews(review1, review2);
            
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
